package com.yincheng.oes.attachment.service;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;

import org.javatuples.Pair;

import com.yincheng.oes.attachment.entity.Attachment;

public interface AttachService {

    /**
     * 上传图片
     *
     * @param files
     * @return
     * @throws IOException
     * @throws FileNotFoundException
     */
    List<Attachment> uploadPic(List<Pair<String, InputStream>> files, String areaId)
            throws FileNotFoundException, IOException;

    /**
     * 导出文件到输出流中
     *
     * @param address
     * @param os
     */
    void exportToOutputStream(String address, OutputStream os);

    /**
     * 获取附件基本信息
     *
     * @param address
     * @return
     */
    Attachment getAttachment(String address);

    /**
     * 获取域下所有附件
     *
     * @param areaId
     * @return
     */
    List<Attachment> getAttachments(String areaId);

    /**
     * 删除附件
     *
     * @param attachmentId
     */
    void deleteAttachmentById(String attachmentId);
}
